const Koa = require('koa')
const app = new Koa()
// 前端向我发送的请求体内的 method和url
// 我要显示在前端页面上

const main = ctx => {
  console.log(ctx.request.method);
  console.log(ctx.request.url);
  let method = ctx.request.method;
  let url = ctx.request.url;
  ctx.response.body = `${method} -- ${url}`;
}

app.use(main)
app.listen(3000)